<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
use think\facade\Request;
class Recharge extends Controller
{
    protected $middleware = ['VerifyLogin'];

    public function item_config()
    {
        $params = Request::get('', '', 'strip_tags,trim');
		$params['lang'] = input('lang','zh2cht');

        $RechargeLogic = \think\facade\App::model('Recharge', 'logic');
        $result = $RechargeLogic->getList($params);

        if($result)
        {
            return json(['code'=>0,'msg'=>'success','data'=>$result]);
        }

        return json(['code'=>102,'msg'=>'数据为空','data'=>[]]);
    }

    public function notice()
    {
		$params = Request::get('', '', 'strip_tags,trim');
		$params['lang'] = input('lang','zh2cht');

		if($params['lang'] == 'en')
		{
			$content = "1.Book coins belong to virtual goods and cannot be returned or exchanged once purchased. The obtained book coins are only valid for use in this bookstore.\n";
			$content .= "2.Member users can read all novels without paying any additional fees.\n";
			$content .= "3.Please contact customer service if the payment has not been received within one hour after recharging.";
		}else{
			$content = "1.书币属于虚拟商品，一经购买不得退换，获得的书币仅限在本书城使用。\n";
			$content .= "2.会员用户阅读全部小说无需支付额外费用。\n";
			$content .= "3.充值后一小时未到账请与客服联系。";
		}
        

        return json(['code'=>0,'msg'=>'success','data'=>['content'=>$content]]);
    }

}